import {
	request,
	requestData
} from "../Promise.js"

function captchaInit(data) {
	return {
		'Captcha-Key': data.key,
		'Captcha-Code': data.code
	}
}

function dataInit(param) {
	const data = {
		...param
	}
	delete data.key;
	data.code = data.num || data.code;
	delete data.num;
	return data;
}
export default {
	// 经营业户查询
	businessOwner(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/businessOwner',
			method: 'post',
			header: captchaInit(data),
			data: dataInit(data),
		})
	},
	// 从业人员
	employees(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/employees',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 营运车辆查询
	queryOperation(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/queryOperation',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 罐体查询
	queryCanBody(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/queryCanBody',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 罐式集装箱查询
	queryTankContainer(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/queryTankContainer',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 企业安全评估
	companyAssess(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/companyAssess',
			method: 'post',
			header: captchaInit(data),
			data: dataInit(data),
		})
	},
	// 企业安全评估详情
	companyAssessDetail(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/companyAssessDetail',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 人员安全评估
	employeesAssess(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/employeesAssess/queryOne',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},
	// 人员安全评估-指标项统计数据
	archiveItem(data){
		return request({
			url:'data-multiterminal/ObsoleteMessageController/employeesAssess/staff/archiveItem/3',
			method: 'post',
			data,
		})
	},
	// 人员安全评估详情
	archiveItemDetailList(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/employeesAssess/staff/archiveItem/detailList',
			method: 'post',
			data,
		})
	},
	// 人员安全评估-历史周期
	archiveItemBefore(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/employeesAssess/staff/archiveItem/before',
			method: 'post',
			data,
		})
	},
	// 电子运单
	queryWaybillMessage(data) {
		return request({
			url: 'data-multiterminal/ObsoleteMessageController/queryWaybillMessage',
			method: 'post',
			header: captchaInit(data),
			data,
		})
	},

	// 常见问题
	commonProblemPage(data) {
		return request({
			url: 'data-multiterminal/multcommonquestion/pageAudit',
			method: 'get',
			data,
		})
	},
	// 常见问题-详情
	commonProblemDetail(id) {
		return request({
			url: 'data-multiterminal/multcommonquestion/detail?id=' + id,
			method: 'get',
		})
	},
	// 信息公告分页
	infoNoticePage(data) {
		return request({
			url: 'qy-server/mgntmsg/app/page',
			method: 'get',
			data,
		})
	},
	updatepassword(data) {
		return request({
			url: `blade-user/update-password?oldPassword=${data.oldPassword}&newPassword=${data.newPassword}&newPassword1=${data.newPassword1}`,
			method: 'post',
		
		})
	},
}
